function A = preparematrix(x)
num = length(x);
A=[ones(num,1),x',(x.^2)'];